<template>
  <div>
    <el-button type="primary" @click="add">添加</el-button>
    <v-list @bianji='bianji'></v-list>
    <v-add :obj='obj' ref="aa"></v-add>
  </div>
</template>

<script>
import vList from "./components/list.vue";
import vAdd from "./components/add.vue";
export default {
  components: {
    vList,
    vAdd,
  },
  data() {
    return {
      obj: {
        istrue: false,
        isadd: true,
      },
    };
  },
  methods: {
    // 点击添加
    add() {
        this.obj.istrue=true
    },
    // list点击了编辑
    bianji(id){
        this.obj.istrue=true
        this.obj.isadd=false
        this.$refs.aa.getinfo(id)
    }
  },
};
</script>

<style lang="less">
</style>